package com.xiaoye.digitaltwin.service.impl;

import com.xiaoye.digitaltwin.common.NullParameterException;
import com.xiaoye.digitaltwin.entity.Neiyacontrol;
import com.xiaoye.digitaltwin.entity.dao.NeiyaConfirm;
import com.xiaoye.digitaltwin.mapper.NeiyacontrolMapper;
import com.xiaoye.digitaltwin.service.INeiyacontrolService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xiaoye
 * @since 2023-08-19
 */
@Service
public class NeiyacontrolServiceImpl extends ServiceImpl<NeiyacontrolMapper, Neiyacontrol> implements INeiyacontrolService {

    @Override
    public Neiyacontrol check(NeiyaConfirm neiyaConfirm) {
        Double press = neiyaConfirm.getPress();

        if (press == null){
            throw new NullParameterException("内压实验压力值为空");
        }

        Neiyacontrol neiyacontrol = new Neiyacontrol();
        neiyacontrol.setPress(press);
        return neiyacontrol;
    }
}
